{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# `tfplot.figure`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tfplot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from PIL import Image\n",
    "from __future__ import print_function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from matplotlib import rcParams, rc\n",
    "from IPython.core.pylabtools import figsize\n",
    "\n",
    "%config InlineBackend.figure_format = 'retina'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def extract_image_summary(s):\n",
    "    from io import BytesIO\n",
    "    ims = []\n",
    "    for i in range(len(s.value)):\n",
    "        png_string = s.value[i].image.encoded_image_string\n",
    "        im = Image.open(BytesIO(png_string))\n",
    "        ims.append(im)\n",
    "    plt.close()\n",
    "    if len(ims) == 1: return ims[0]\n",
    "    else: return ims"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sample Figure"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAhkAAAH4CAYAAADn6v8xAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAWJQAAFiUBSVIk8AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3XmUVOWd//HPF1lsodOCkWiiQkA2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O9s1NW2ugbopqN2r1U2unfvnnTlWSyQongR\nMlB02rVrlxQ0EqffLnZdunSJu197uupMJf6aaNeuXbOulYn6QkamX5XEpBr8metXJYnnO5e/p8R9\n83W+s1HXlSzvvPNOVrVy+RtF00XIQNExs6Rr+V9//fWk6/2L2cCBA+Pu7969O6s3vvfffz/pE2Zi\nbV/qmi8jFgYyHfQZM2jQIJ1wwgkN1pPSG/QZk3hOtm7dmjTjajpWrlyZNDA5X+c7G7169Uq6oieb\nGWF3796ddThB00bIQFEaPXp03P29e/dmNalXY1XXpFTZPL/HH388rdq+JPYmrFq1Stu3b4/reWje\nvHnab8SlpaVx8zh88MEH+vDDD5N6Mjp16nT8J9nT0VTOd6bqGgszb968jAP7nDlz6hyQDRAyUJQm\nTJiQdD3/Pffck/X3yY1N//79k2acnDZtWtKkUfVZv369fvOb38StO/vss/N6xUVdx5o5c2bcfBZ9\n+vTJ6GqexF6PWbNmJf3uSKbPcdiwYUlfmTz66KOqqqpKu8bq1av13//933HrzjnnnEbdkyFJkyZN\niru/e/duPfDAA2nvv3//ft13331RNwtNBCEDRamkpET//u//Hrdu69atuvTSS7Vz586sah49elRz\n5sxJmjugUBKvljl8+LAmTpyo/fv3N7jvgQMHdPXVV+vQoUNx67/73e+qWbP8/W9f15t94htYpp/0\nEx9f1xtipiHDzPTd7343bt3Bgwd1zTXXJJ3DulRXV2vixIlJn+Zvv/32jNpRCOPHj0+6Yuvee+9N\n+k2TujjndPPNN+c0UDZm6tSpSbPxzpkzJ+e6KCxCBorWzTffnPTjZsuXL1fv3r31hz/8Ie25INat\nW6ef//znOvvss/WNb3wjrTfxfLjuuuuSfq9k2bJlGj16dNwv0CaqqqrSmDFjkn4z47zzztONN97o\npa2pdOnSRV/4whfi1iWGwHTHY8QMGTJEZpaynpTZeIyYf/mXf9F5550Xt+7111/XRRddlDSTaG1r\n167VqFGj9NZbb8Wt79OnT1Y/spZvJSUluv/+++PWHTx4UGPHjq33F4n37duna6+9VrNmzZKkuH8T\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K+3QquLplQ\n6OdY4PM7Jd3XUgXBLOXrayb/VtneironAwAANF7FfHUJAABoxAgZAADAC0IGAADwgpABAAC8IGQA\nAAAvCBkAAMALQgYAAPCCkAEAALwgZAAAAC8IGQAAwAtCBgAA8IKQAQAAvCBkAAAALwgZAADAC0IG\nAADwgpABAAC8IGQAAAAv/j/mxviRAAEkugAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11c9ee5c0>"
      ]
     },
     "execution_count": 6,
     "metadata": {
      "image/png": {
       "height": 252,
       "width": 268
      }
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def test_figure():\n",
    "    fig, ax = tfplot.subplots(figsize=(4, 4))\n",
    "    ax.text(0.5, 0.5, \"Hello World!\",\n",
    "            ha='center', va='center', size=24)\n",
    "    return fig\n",
    "\n",
    "fig = test_figure()\n",
    "fig"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `tfplot.figure.to_array()`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This method converts a matplotlib `Figure` object into a `numpy.ndarray`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(288, 288, 4)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "im_fig = tfplot.figure.to_array(fig)\n",
    "im_fig.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAXDklEQVR4nO3dfXBV9Z3H8fc3kCCo\nPCYCJTxWFLDaCikrSsEtrhPcGRjbVaE4wJaW+pTu1B0dLAx1gNbqdrszdnAx061inYpUp1umRd2K\nYUAxEvAJ0OpEyy5BCxgjD+Ex8t0/7kNvknvzcA/Jj1w+r5k73nPO757fN8fLJ7/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GrjcTZip47vADuAWWd5veOAV+Lh9CZwfeB6\nnwI+Bk4RG00uAG4Dbks5vivjP8+Ojn5P6EpoEQlGV0KLSDAKIBEJRgEkIsEogEQkGAWQiASjABKR\nYBRAIhKMAkhEglEAiUgwCiARCUYBJCLBKIBEJBgFkIgEowASkWAUQCISjAJIRIJRAIlIMAogEQlG\nASQiwSiARCSY/wdUxResvFh8twAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<PIL.Image.Image image mode=RGBA size=288x288 at 0x11C90E390>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Image.fromarray(im_fig)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `tfplot.figure.to_summary()`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This method converts a matplotlib `Figure` object into `tf.Summary` protobuf object, containing a single image summary. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'tensorflow.core.framework.summary_pb2.Summary'>\n",
      "tag : figure/image/0\n",
      "height : 288\n",
      "width : 288\n",
      "len(PNG) : 6065\n"
     ]
    }
   ],
   "source": [
    "summary = tfplot.figure.to_summary(fig, \"figure/image/0\")\n",
    "\n",
    "print(type(summary))\n",
    "print(\"tag :\", summary.value[0].tag)\n",
    "print(\"height :\", summary.value[0].image.height)\n",
    "print(\"width :\", summary.value[0].image.width)\n",
    "print(\"len(PNG) :\", len(summary.value[0].image.encoded_image_string))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAXDklEQVR4nO3dfXBV9Z3H8fc3kCCo\nPCYCJTxWFLDaCikrSsEtrhPcGRjbVaE4wJaW+pTu1B0dLAx1gNbqdrszdnAx061inYpU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0Fs7tJaAB+EGYr+9PgAWx9ctIzZ6gNhv\nit8C1cBWYFTg/2mt1fsisA94M/5YF7LettTcpG3wAGrjcTZip47vADuAWWd5veOAV+Lh9CZwfeB6\nnwI+Bk4RG00uAG4Dbks5vivjP8+Ojn5P6EpoEQlGV0KLSDAKIBEJRgEkIsEogEQkGAWQiASjABKR\nYBRAIhKMAkhEglEAiUgwCiARCUYBJCLBKIBEJBgFkIgEowASkWAUQCISjAJIRIJRAIlIMAogEQlG\nASQiwSiARCSY/wdUxResvFh8twAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<PIL.PngImagePlugin.PngImageFile image mode=RGBA size=288x288 at 0x11CC69898>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "extract_image_summary(summary)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
